<template>
  <div class="container">
    <div class="login-container">
      <div class="illustration-section">
      </div>

      <div class="login-section">
        <div class="logo-container">
          <div class="logo">
            <img class="logo" src="@/assets/home-img/logo.png">
            <img class="name" src="@/assets/home-img/name.png">
          </div>
          <div class="system-name">厦门翔安医院痛风智能随访系统</div>
        </div>

        <div class="form-container">
          <div class="input-group">
            <span class="input-icon">👤</span>
            <input v-model="loginDto.username" type="text" class="form-input" placeholder="请输入账号">
          </div>

          <div class="input-group">
            <span class="input-icon">🔒</span>
            <input v-model="loginDto.password" type="password" class="form-input" placeholder="请输入密码">
          </div>

<!--          <div class="input-group">-->
<!--            <div class="captcha-group">-->
<!--              <input type="text" class="captcha-input" placeholder="请输入验证码">-->
<!--              <div class="captcha-display">8564</div>-->
<!--            </div>-->
<!--          </div>-->

          <button @click="submit" class="login-button">立即登录</button>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import {ref,reactive} from "vue"
import {useRouter, useRoute} from 'vue-router'

const router = useRouter()  // 用于编程式导航
const route = useRoute()    // 用于获取当前路由信息

const loginDto = reactive({
  username:"",
  password:""
})

function submit(){
  console.log({...loginDto},"222")
  if(!loginDto.username){
    ElMessage.warning("请输入账号")
    return
  }
  if(!loginDto.password){
    ElMessage.warning("请输入密码")
    return
  }
  if(loginDto.username != "admin"){
    ElMessage.warning("账号或密码不正确")
    return
  }
  if(loginDto.password != "123456"){
    ElMessage.warning("账号或密码不正确")
    return
  }
  router.push({
    path:"patient-search",
  })
}

</script>

<style lang="scss" scoped>
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  margin: 0 auto;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background-color: #e6f0ff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  position: relative;
  width: 100vw;
}
.login-container {
  display: flex;
  width: 900px;
  height: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.illustration-section {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url("@/assets/home-img/doctor.png");
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.7; /* 调整透明度，0.7表示70%不透明 */
  z-index: -1;
}


.illustration-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #7aa7f5;
  border-radius: 50%;
  transform: scale(1.2);
  opacity: 0.5;
}

.illustration {
  position: relative;
  width: 80%;
  z-index: 2;
}

.lab-elements {
  position: absolute;
  font-size: 24px;
  color: white;
  opacity: 0.5;
}

.lab-element-1 {
  top: 50px;
  left: 100px;
}

.lab-element-2 {
  top: 80px;
  right: 120px;
}

.lab-element-3 {
  bottom: 70px;
  left: 150px;
}

.lab-element-4 {
  bottom: 100px;
  right: 90px;
}

.login-section {
  flex: 1;
  background-color: white;
  padding: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-container {
  margin-bottom: 10px;
  text-align: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #4180d0;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  .logo{
    width: 40px;
    height: 40px;
  }
  .name{
    width: 200px;
    height: 40px;
  }
  img{
    object-fit: cover;
  }
}

.logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #4ba;
  border-radius: 50%;
  margin: 0 2px;
}

.system-name {
  display: inline-block;
  padding: 5px 10px;
  color: #4180d0;
  font-size: 16px;
  border-radius: 4px;
  margin-top: 5px;
}

.form-container {
  width: 100%;
  margin-top: 30px;
}

.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
}

.form-input {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.form-input:focus {
  border-color: #4180d0;
}

.captcha-group {
  display: flex;
  align-items: center;
}

.captcha-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.captcha-display {
  margin-left: 10px;
  width: 100px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 5px;
  color: #4aaf51;
}

.login-button {
  width: 100%;
  padding: 12px;
  background-color: #1976d2;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 20px;
  transition: background-color 0.3s;
}

.login-button:hover {
  background-color: #1565c0;
}

/* 科研人员图形 */
.researchers {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 220px;
}

.researcher {
  position: relative;
  width: 100px;
  height: 180px;
  margin: 0 5px;
}

.head {
  position: absolute;
  width: 60px;
  height: 60px;
  background-color: #ffdbac;
  border-radius: 50%;
  top: 0;
  left: 20px;
  z-index: 2;
}

.body {
  position: absolute;
  width: 70px;
  height: 100px;
  background-color: white;
  border-radius: 15px 15px 0 0;
  top: 50px;
  left: 15px;
  z-index: 1;
}

.hair {
  position: absolute;
  width: 70px;
  height: 30px;
  background-color: #6e4a26;
  border-radius: 30px 30px 0 0;
  top: -5px;
  left: 15px;
  z-index: 1;
}

.researcher.female .hair {
  height: 60px;
  border-radius: 0;
  background-color: #1a1a2e;
  top: -10px;
}

.face {
  position: absolute;
  top: 35px;
  width: 40px;
  height: 10px;
  left: 30px;
  z-index: 3;
}

.eyes {
  position: relative;
  display: flex;
  justify-content: space-between;
  width: 30px;
  margin: 0 auto;
}

.eye {
  width: 8px;
  height: 4px;
  background-color: #1a1a2e;
  border-radius: 50%;
}

.mouth {
  width: 10px;
  height: 3px;
  background-color: #c85050;
  border-radius: 3px;
  margin: 5px auto 0;
}

.lab-props {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  z-index: 3;
}

.microscope {
  width: 40px;
  height: 60px;
  position: relative;
}

.microscope-base {
  width: 30px;
  height: 10px;
  background-color: #555;
  position: absolute;
  bottom: 0;
  left: 5px;
}

.microscope-arm {
  width: 8px;
  height: 40px;
  background-color: #777;
  position: absolute;
  bottom: 10px;
  left: 16px;
}

.microscope-head {
  width: 20px;
  height: 15px;
  background-color: #444;
  position: absolute;
  top: 0;
  left: 10px;
  border-radius: 3px;
}

.flask {
  width: 20px;
  height: 30px;
  background-color: rgba(255, 100, 100, 0.6);
  position: relative;
  border-radius: 0 0 10px 10px;
  margin-right: 10px;
}

.flask:before {
  content: "";
  position: absolute;
  top: -10px;
  left: 5px;
  width: 10px;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 5px 5px 0 0;
}

.test-tubes {
  display: flex;
  margin-left: 15px;
}

.test-tube {
  width: 10px;
  height: 40px;
  background-color: rgba(100, 200, 255, 0.6);
  border-radius: 0 0 5px 5px;
  margin-right: 8px;
}

.clipboard {
  width: 40px;
  height: 50px;
  background-color: #e8c496;
  border-radius: 5px;
  position: absolute;
  left: -20px;
  top: 80px;
  z-index: 3;
}

.clipboard:after {
  content: "";
  position: absolute;
  top: 10px;
  left: 5px;
  width: 30px;
  height: 30px;
  background-color: white;
  border-radius: 2px;
}

.laptop {
  width: 60px;
  height: 40px;
  background-color: #777;
  border-radius: 5px;
  position: absolute;
  left: -60px;
  bottom: 0;
  z-index: 2;
}

.laptop:after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 50px;
  height: 30px;
  background-color: #3a7bd5;
  border-radius: 2px;
}
</style>
